package bancosys.tec.security.impl;

import java.io.Serializable;
import java.security.Principal;

/**
 * Principal usado pelo security-impl
 * 
 * @created 25/03/2008
 * @author Gustavo Almeida
 */
public class SecurityPrincipal implements Principal, Serializable {
    private String name;

    /**
     * Construtor.
     * 
     * @param name username.
     */
    public SecurityPrincipal(String name) {
        if (name == null) {
            throw new NullPointerException("Nome deve ser diferente de null");
        }
        this.name = name;
    }

    /**
     * Devolve o username.
     * 
     * @return o username.
     */
    public String getName() {
        return this.name;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return name;
    }

}
